//
//  WhzPDDSearchCollectionReusableView.m
//  WhzPinDuoDuo
//
//  Created by whz on 16/11/18.
//  Copyright © 2016年 whz. All rights reserved.
//

#import "WhzPDDSearchCollectionReusableView.h"
#import <Masonry.h>

@interface WhzPDDSearchCollectionReusableView ()

@property(nonatomic, strong)UILabel *labelSectionName;

@end

@implementation WhzPDDSearchCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame {

    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}

#pragma mark - 初始化UI
- (void)setupUI {

    // MARK: - 组头
    self.labelSectionName = [[UILabel alloc] init];    
    self.labelSectionName.text = @"组头";
    self.labelSectionName.font = [UIFont systemFontOfSize:15];
    [self addSubview:self.labelSectionName];
    [self.labelSectionName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(10);
        make.centerY.equalTo(self.mas_centerY);
    }];
}

/**
 重写set方法 赋值
 
 @param rootModel 数组模型
 */
- (void)setRootModel:(NSArray<WhzPDDRootModel *> *)rootModel {

    _rootModel = rootModel;

    self.labelSectionName.text = rootModel[self.indexPathForSection].opt_name;
}

@end
